■<HTML>
<!-- Copyright (c) Microsoft Corporation. All rights reserved.-->
<HEAD>
<TITLE>Network Configuration Page</TITLE>
<SCRIPT LANGUAGE="VBScript">
<!--
Option Explicit
'Windows constants for key codes
Public Const EnterKey = 13
Public Const EscapeKey = 27
Public Const TabKey = 9
'color constants
Public Const BLACK = "#000000"
Public Const WHITE = "#FFFFFF"
'Timer for idle timeout
Dim iIdleTimeOut
'----------------------------------------------------------------------------
' Function: Window_OnLoad
' Description: Initialization routine for the page
' Input Variables: None
' Output Variables: None
' Return Values: None
' Global Variables: AlertsArray,NumberOfAlerts,bAlertViewMode,bOnlyOnePage
'----------------------------------------------------------------------------
Sub Window_OnLoad()
'Localization manager object
Dim objLocMgr
'Replacement strings
Dim varReplacementStrings
'Text for static ip task
Dim strStaticIpText
'Text for dynamic ip task
Dim strAutoIpText
'Resource ID for static task
Const STATIC_IP_TEXT = "&H40020008"
'Resource ID for auto task
Const AUTO_IP_TEXT = "&H40020005"
'SaHelper component object
Dim objSaHelper
'Flag for DHCP configuration
Dim bDHCPEnabled
On Error Resume Next
Err.Clear
'Create the localization manager
Set objLocMgr = CreateObject("ServerAppliance.LocalizationManager")
If Err.number = 0 Then
'Get the strings
strStaticIpText = objLocMgr.GetString("salocaluimsg.dll",STATIC_IP_TEXT,varReplacementStrings)
strAutoIpText = objLocMgr.GetString("salocaluimsg.dll",AUTO_IP_TEXT,varReplacementStrings)
Set objLocMgr = Nothing
End If
'Display the strings
SaDynamicIP.innerText = strAutoIpText
SaStaticIP.innerText = strStaticIpText
Err.Clear
'get the current configuration
Set objSaHelper = CreateObject("ServerAppliance.SAHelper")
If Err.number <> 0 Then
SaDynamicIP.focus
Else
bDHCPEnabled = objSaHelper.IsDHCPEnabled
If Err.number <> 0 or bDHCPEnabled = true Then
SaDynamicIP.focus
Else
SaStaticIP.focus
End If
Set objSaHelper = Nothing
End If
'start the timer for idle timeout
iIdleTimeOut = window.SetTimeOut("IdleHandler()",300000)
On Error Resume Next
Err.Clear
'set the key codes for the page
Dim objKeypad
Set objKeypad = CreateObject("Ldm.SAKeypadController")
If Err.number = 0 Then
objKeypad.Setkey 0,TabKey,TRUE
objKeypad.Setkey 1,TabKey,FALSE
objKeypad.Setkey 2,0,FALSE
objKeypad.Setkey 3,0,FALSE
objKeypad.Setkey 4,EscapeKey,FALSE
objKeypad.Setkey 5,EnterKey,FALSE
Set objKeypad = Nothing
End If
End Sub
'----------------------------------------------------------------------------
' Function: IdleHandler
' Description: Goes back to main page when timeout expires
' Input Variables: None
' Output Variables: None
' Return Values: None
' Global Variables: None
'----------------------------------------------------------------------------
Sub IdleHandler()
window.history.go(-2)
End Sub
'----------------------------------------------------------------------------
' Function: InvertSelection
' Description: Inverts the focus element's background and foreground
' Input Variables: intIndex, index of the focus element
' Output Variables: None
' Return Values: None
' Global Variables: None
'----------------------------------------------------------------------------
Sub InvertSelection(intIndex)
'Invert the background and foreground for the focus element
If intIndex = 0 Then
SaDynamicIP.style.backgroundColor = BLACK
SaDynamicIP.style.color = WHITE
Else
SaStaticIP.style.backgroundColor = BLACK
SaStaticIP.style.color = WHITE
End If
End Sub
'----------------------------------------------------------------------------
' Function: InvertToNormal
' Description: Inverts element that loses focus to normal
' Input Variables: intIndex, index of the element loosing the focus
' Output Variables: None
' Return Values: None
' Global Variables: None
'----------------------------------------------------------------------------
Sub InvertToNormal(intIndex)
'Invert the background and color for the element loosing the focus
If intIndex = 0 Then
SaDynamicIP.style.backgroundColor = ""
SaDynamicIP.style.color = BLACK
Else
SaStaticIP.style.backgroundColor = ""
SaStaticIP.style.color = BLACK
End If
End Sub
'----------------------------------------------------------------------------
' Function: KeyDown
' Description: Handles key presses
' Input Variables: None
' Output Variables: None
' Return Values: None
' Global Variables: None
'----------------------------------------------------------------------------
Sub KeyDown()
'clear the timeout and restart it
window.clearTimeOut(iIdleTimeOut)
iIdleTimeOut = window.SetTimeOut("IdleHandler()",300000)
'If escape key is hit, go back to tasks page
If window.event.keycode = EscapeKey Then
window.history.back
End If
End Sub
-->
</SCRIPT>
</HEAD>
<BODY RIGHTMARGIN=0 LEFTMARGIN=0>
<A ID="SaDynamicIP" STYLE="position:absolute; top:0; left:0; font-size:10; font-family=arial;"
href="localui_dynamic.htm" HIDEFOCUS=true OnFocus="InvertSelection(0)" OnKeydown="KeyDown"
OnBlur="InvertToNormal(0)">
</A>
<A ID="SaStaticIP" STYLE="position:absolute; top:13; left:0; font-size:10; font-family=arial;"
href="localui_static.htm" HIDEFOCUS=true OnFocus="InvertSelection(1)" OnKeydown="KeyDown"
OnBlur="InvertToNormal(1)">
</A>
</BODY>
</HTML>